package com.yeyks.common.utils.base;

import cn.hutool.core.util.StrUtil;
import com.yeyks.common.exception.ServiceException;

import java.util.regex.Pattern;

/*
单个参数校验工具
 */
public class CheckUtil {

    private static final Pattern phonePattern = Pattern.compile("^1[3456789]\\d{9}$");

    public static void checkPhone(String phone) {
        if (!phonePattern.matcher(phone).matches()) {
            throw new ServiceException("手机号码验证失败");
        }
    }

}
